***** OPEN OUTPUT LOG FILE FOR APPENDIX ANALYSES A *****

log using "C:\Users\Jason\Dropbox\Jason Byers\Co-Authored Projects\Projects with George Krause\Krause Projects\Confirmation Dynamics Project\Appointee Tenure Project\Jason Byers\March 2023\DART (PRQ)\Output\Hardwiring Committment.APPENDIX A.04-21-2023.smcl", replace






*** APPENDIX ANALYSES A: UNIVARIATE DISTIRBUTIONS OF PRRESIDENTIAL LOYALTY COVARIATE & ALTERNATIVE ESTIMATION APPROACHES ****




** RETRIEVE SINGLE EVENT RECORDS DATABASE [N = 860 APPOINTEE OBSERVATIONS: 831 UNCENSORED OBSERVATIONS; 29 CENSORED OBSERVATIONS] **

use "C:\Users\Jason\Dropbox\Jason Byers\Co-Authored Projects\Projects with George Krause\Krause Projects\Confirmation Dynamics Project\Appointee Tenure Project\Jason Byers\March 2023\DART (PRQ)\Data\Krause and Byers.SRD.06-03-2022.dta", replace


*
*


** GENERATE CENSORING VARIABLE FOR HOLDOVER APPOINTEES SERVING BETWEEN/ACROSS ADMINISTRATIONS [=1]; UNCENSRED OBSERVATIONS [=0] ** 

gen singleadmin_service=1 if holdover==0
*
replace singleadmin_service=0 if holdover==1
*
*
tab singleadmin_service


** SET FOR SURVIVAL DATA WITH A SINGLE RECORD PER APPOINTEE OBSERVATION [N = 860: UNCENSORED N = 831; CENSORED N = 29] ** 
stset okapptdur, failure(singleadmin_service)






**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




*** APPENDIX ANALYSES A: UNIVARIATE DISTIRBUTIONS OF PRRESIDENTIAL LOYALTY COVARIATE & ALTERNATIVE ESTIMATION APPROACHES ****

*** FIGURE A0 ***

kdensity zloyalmedian, lcolor(black) addplot((kdensity zloyalmedian if soubinaryagency2nom==0, lcolor(gs6) lpattern(dash)) kdensity zloyalmedian if soubinaryagency2nom==1, lcolor(gs10) lpattern(longdash_dot)) xline(0, lcolor(red%40) lpattern(dash)) ylabel(0(0.2)0.8, angle(0) labsize(small)) xlabel(-2(1)3, angle(0) labsize(small)) note("") ytitle("Density", size(small) margin(r=2.5)) xtitle("Presidential Loyalty", size(small) margin(t=2)) title("FIGURE A0: Univariate Distributions of Presidential Loyalty Covariate", size(medsmall)) legend(order(1 "Presidential Loyalty (Full Sample)" 2 "Presidential Loyalty (Non-Policy Priority Agencies)" 3 "Presidential Loyalty (Policy Priority Agencies)") size(small))

*
graph save "Graph" "C:\Users\Jason\Dropbox\Jason Byers\Co-Authored Projects\Projects with George Krause\Krause Projects\Confirmation Dynamics Project\Appointee Tenure Project\Jason Byers\March 2023\DART (PRQ)\Graphics\FigureA0.gph", replace






*** APPENDIX ANALYSES A: UNIVARIATE DISTIRBUTIONS OF PRRESIDENTIAL LOYALTY COVARIATE & ALTERNATIVE ESTIMATION APPROACHES ****




*** FIRST, BEGIN WITH MANUSCRIPT REPORTED MODELS 2 & 4 -- AND FIGURE 2 FOR THE GRAPHICAL PRESENTATION TO BE INCLUDED IN THE APPENDIX DOCUMENT




**** MODEL 2: COX MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

stcox   c.zloyalmedian##i.soubinaryagency2nom  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp  okstartunemployment  i. okstartadyr  i.sbagency reagan bush41 clinton bush43,  hr vce(cluster sbagency)
*
estat ic


*** COMPUTE Figure A1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {PP − NPP Difference} {{4 [M1−M4] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQ = 1.3653231 [0.9692858 - (-0.3960373)]

lincomest 1.soubinaryagency2nom#c.zloyalmedian*1.3653231, eform(hr)
matrix model2zloyal = r(table)
mat list model2zloyal




**** COMPUTE Figure A2: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the MEDIAN NUMBER OF DAYS OF APPOINTEE TENURE {PP − NPP Difference} {{4 [M1−M4] × 1 Horizontal Point Estimates and 95% CIs}.
** NOTE: IQR = 1.3653231 [0.9692858 - (-0.3960373)]



**** MODEL 4: WEIBULL MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

streg   c.zloyalmedian##i.soubinaryagency2nom  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i. okstartadyr  i.sbagency reagan bush41 clinton bush43, distribution(weibull) hr vce(cluster sbagency)
*
estat ic



*** COMPUTE Figure A1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {PP − NPP Difference} {{4 [M1−M4] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQ = 1.3653231 [0.9692858 - (-0.3960373)]

lincomest 1.soubinaryagency2nom#c.zloyalmedian*1.3653231, eform(hr)
matrix model4zloyal = r(table)
mat list model4zloyal





**** COMPUTE Figure A2: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the MEDIAN NUMBER OF DAYS OF APPOINTEE TENURE {PP − NPP Difference} {{4 [M1−M4] × 1 Horizontal Point Estimates and 95% CIs}.
** NOTE: IQR = 1.3653231 [0.9692858 - (-0.3960373)]

** Generate 'manual' interaction variable ** 
generate loyalppdiff = soubinaryagency2nom*zloyalmedian

** Re-Estimate Model 4  with 'manual' interaction variable **
streg   zloyalmedian soubinaryagency2nom loyalppdiff  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i.okstartadyr i.sbagency reagan bush41 clinton bush43, distribution(weibull) hr vce(cluster sbagency)

estimates store model4a

margins, predict(median time) at(loyalppdiff=(-0.3960373 0.9692858))

** Generate Differential Predicted Median Survival Time of Senate Committee Stage of Confirmation Process -- Based on Interquartile Differential [corresponding to Differential Marginal Hazard Ratio Estimates] **
margins, predict(median time) at(loyalppdiff=(-0.3960373 0.9692858))  contrast(atcontrast(r))

matrix model4azloyal = r(table)
mat list model4azloyal



estimates restore model4a

margins, predict(median time) at(loyalppdiff=(-0.6451644 1.711348))
margins, predict(median time) at(loyalppdiff=(-0.6451644 1.711348))  contrast(atcontrast(r))

matrix model4bzloyal = r(table)
mat list model4bzloyal



*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************





**** ALTERNATIVE ESTIMATION OF REPORTED MODEL B1: GOMPERTZ & GENERALIZED GAMMA REGRESSION MODELING  ***




**** MODEL A1.1: GOMPERTZ MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

streg   c.zloyalmedian##i.soubinaryagency2nom  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i. okstartadyr  i.sbagency reagan bush41 clinton bush43, distribution(gompertz) hr vce(cluster sbagency)
*
estat ic


*** COMPUTE Figure A1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {STANDALONE − NON-STANDALONE Difference} {{2 [M2 & M4] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQ = 1.3653231 [0.9692858 - (-0.3960373)]

lincomest 1.soubinaryagency2nom#c.zloyalmedian*1.3653231, eform(hr)
matrix modelA11zloyal = r(table)
mat list modelA11zloyal




**** COMPUTE Figure A2: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the MEDIAN NUMBER OF DAYS OF APPOINTEE TENURE {PP − NPP Difference} {{4 [M1−M4] × 1 Horizontal Point Estimates and 95% CIs}.
** NOTE: IQR = 1.3653231 [0.9692858 - (-0.3960373)]
drop loyalppdiff
generate loyalppdiff = soubinaryagency2nom*zloyalmedian

** Re-Estimate Model A11  with 'manual' interaction variable **
streg   zloyalmedian soubinaryagency2nom loyalppdiff  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i.okstartadyr i.sbagency reagan bush41 clinton bush43, distribution(gompertz) hr vce(cluster sbagency)

estimates store modela11

margins, predict(median time) at(loyalppdiff=(-0.3960373 0.9692858))

** Generate Differential Predicted Median Survival Time of Senate Committee Stage of Confirmation Process -- Based on Interquartile Differential [corresponding to Differential Marginal Hazard Ratio Estimates] **

margins, predict(median time) at(loyalppdiff=(-0.3960373 0.9692858))  contrast(atcontrast(r))

matrix modelA11azloyal = r(table)
mat list modelA11azloyal



estimates restore modela11

margins, predict(median time) at(loyalppdiff=(-0.6451644 1.711348))
margins, predict(median time) at(loyalppdiff=(-0.6451644 1.711348))  contrast(atcontrast(r))

matrix modelA11bzloyal = r(table)
mat list modelA11bzloyal







**** MODEL A1.2: GENERALIZED GAMMA MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

** First, Estimate Weibull Model Analog in AFT metric for Comparison Purposes to Generalized Gamma Model **

streg   c.zloyalmedian##i.soubinaryagency2nom  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp  okstartunemployment  okstartunemp  i. okstartadyr  i.sbagency reagan bush41 clinton bush43,   time distribution(weibull) hr vce(cluster sbagency)
*
*
** Now, Estimate the Generalized Gamma Model of Interest **

streg   c.zloyalmedian##i.soubinaryagency2nom  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp  okstartunemployment  okstartunemp  i. okstartadyr  i.sbagency reagan bush41 clinton bush43,  distribution(ggamma) hr vce(cluster sbagency)
*
estat ic


*** COMPUTE Figure A1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {STANDALONE − NON-STANDALONE Difference} {{2 [M2 & M4] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQ = 1.3653231 [0.9692858 - (-0.3960373)]

lincomest 1.soubinaryagency2nom#c.zloyalmedian*1.3653231, eform(hr)
matrix modelA12zloyal = r(table)
mat list modelA12zloyal




**** COMPUTE Figure A2: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the MEDIAN NUMBER OF DAYS OF APPOINTEE TENURE {PP − NPP Difference} {{4 [M1−M4] × 1 Horizontal Point Estimates and 95% CIs}.
** NOTE: IQR = 1.3653231 [0.9692858 - (-0.3960373)]

drop loyalppdiff
generate loyalppdiff = soubinaryagency2nom*zloyalmedian

** Re-Estimate Model A12  with 'manual' interaction variable **
streg   zloyalmedian soubinaryagency2nom loyalppdiff  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i.okstartadyr i.sbagency reagan bush41 clinton bush43, distribution(ggamma) hr vce(cluster sbagency)

estimates store modela12

margins, predict(median time) at(loyalppdiff=(-0.3960373 0.9692858))

** Generate Differential Predicted Median Survival Time of Senate Committee Stage of Confirmation Process -- Based on Interquartile Differential [corresponding to Differential Marginal Hazard Ratio Estimates] **

margins, predict(median time) at(loyalppdiff=(-0.3960373 0.9692858))  contrast(atcontrast(r))

matrix modelA12azloyal = r(table)
mat list modelA12azloyal



estimates restore modela12

margins, predict(median time) at(loyalppdiff=(-0.6451644 1.711348))
margins, predict(median time) at(loyalppdiff=(-0.6451644 1.711348))  contrast(atcontrast(r))

matrix modelA12bzloyal = r(table)
mat list modelA12bzloyal


**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




**** ALTERNATIVE ESTIMATION OF REPORTED MODELS --  A2: COMPETING RISKS MODEL  ***

*** GENERATE BINARY INDICATOR WHETHER SUBSEQUENT POSITION WAS IN A DIFFERENT PRESIDENTIAL-APPOINTED POSITION [POSTEMPLOYMENT <= 3] VERSUS ///
*** A NON-PRESIDENTIAL APPOINTED POSITION [3 < POSTEMPLOYMENT < 7], WITH 33 MISSING CASES/COULD NOT LOCATE/DETERMINE SUBSEQUENT POSITION CONSTITUTING 3.84% OF FULL SAMPLE. 

generate postemploymentpres = 1 if postemployment <= 3
replace postemploymentpres = 0 if postemployment > 3

*** PLREIMINARY STATISTICAL ANALYSIS TO DEMONSTRATE THAT APPOINTEE TENURE DURATION DOES NOT SYSTEMATICALLY DIFFER BETWEEN THE TWO GROUPS ***

** FIRST, EQUALITY OF MEANS (t) TEST ***

ttest okapptdur, by(postemploymentpres) reverse unequal

** SECOND, EQUALITY OF STANDARD DEVIATION [F] TEST **

sdtest okapptdur, by(postemploymentpres)

** THIRD, EQUALITY OF DISTRIBUTION FUNCTIONS [NONPARAMETRIC KOLMOGOROV-SMIRNOV TEST] **

ksmirnov okapptdur, by(postemploymentpres) exact


****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************



*** SET SURVIVAL TIME TO ACCOUNT FOR COMPETING RISKS USING POSTEMPLOYMENT==1 AS BASELINE -- APPOINTEE DEPARTS FOR A DIFFERENT PRESIDENTIAL-APPOINTED POSITION ***

stset okapptdur, failure(postemploymentpres==1)


**** MODEL A2.1: COMPETING RISKS DURATION MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****
*** NOTE: EXCLUDE POSTEMPLOYMENT == 9999 CASES SINCE LACK INFORMATION ON SUBSEQUENT POSITION [N = 33] AS NOTED ABOVE

stcrreg   c.zloyalmedian##i.soubinaryagency2nom  zpecompmedian  zmecompmedian  toplevel2 presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp  okstartunemployment  i. okstartadyr  i.sbagency reagan bush41 clinton bush43 if postemployment!=9999,  compete(postemploymentpres==0) hr vce(cluster sbagency)

estat ic


*** COMPUTE Figure A1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {STANDALONE − NON-STANDALONE Difference} {{2 [M2 & M4] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQ = 1.3670962 [0.9710589 - (-0.3960373)] for reduced sample N = 827 **

lincomest 1.soubinaryagency2nom#c.zloyalmedian*1.3670962, eform(hr)
matrix modelA21zloyal = r(table)
mat list modelA21zloyal



**** COMPUTE Figure A2: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the MEDIAN NUMBER OF DAYS OF APPOINTEE TENURE {PP − NPP Difference} {{4 [M1−M4] × 1 Horizontal Point Estimates and 95% CIs}.
** NOTE: IQ = 1.3670962 [0.9710589 - (-0.3960373)] for reduced sample N = 827 **





*** ALTHOUGH THE PREVIOUS RESULTS ARE ESTIMATING SUBHAZARD COMPETING RISKS-- IT IS BASED ON A DIFFERENT SAMPLE SINCE 33 CASES ARE OMITTED DUE TO LACK OF INFORMATION ON SUBSEQUENT POSITION FOLLOWING DEPARTURE FROM APPOINTED POSITION (I.E., POSTEMPLOYMENT==9999), WE ANALYZE M2 FROM THE MANUSCRIPT [COX MODEL] BASED ON N = 827 TO ENSURE THAT THE CORE FINDING HOLDS


*** FIRST, MUST RESET "STSET" COMMAND TO ACCOUNT FOR STANDARD (NON-COMPETING RISKS) MODEL ***

** SET FOR SURVIVAL DATA WITH A SINGLE RECORD PER APPOINTEE OBSERVATION [N = 860: UNCENSORED N = 831; CENSORED N = 29] ** 
stset okapptdur, failure(singleadmin_service)



**** MODEL A2.2: COX MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

stcox   c.zloyalmedian##i.soubinaryagency2nom  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp  okstartunemployment  i. okstartadyr  i.sbagency reagan bush41 clinton bush43 if postemployment!=9999,  hr vce(cluster sbagency)
*
estat ic


*** COMPUTE Figure A1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {PP − NPP Difference} {{4 [M1−M4] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQ = 1.3670962 [0.9710589 - (-0.3960373)] for reduced sample N = 827 **
 
lincomest 1.soubinaryagency2nom#c.zloyalmedian*1.3670962, eform(hr)
matrix modelA22zloyal = r(table)
mat list modelA22zloyal



**** COMPUTE Figure A2: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the MEDIAN NUMBER OF DAYS OF APPOINTEE TENURE {PP − NPP Difference} {{4 [M1−M4] × 1 Horizontal Point Estimates and 95% CIs}.
** NOTE: IQ = 1.3670962 [0.9710589 - (-0.3960373)] for reduced sample N = 827 **

** Re-Estimate Model A12  with 'manual' interaction variable **
drop loyalppdiff
generate loyalppdiff = soubinaryagency2nom*zloyalmedian

streg   zloyalmedian soubinaryagency2nom loyalppdiff  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i.okstartadyr i.sbagency reagan bush41 clinton bush43 if postemployment!=9999, distribution(weibull)hr vce(cluster sbagency)

estimates store modela22

margins, predict(median time) at(loyalppdiff=(-0.3960373 0.9710589))

** Generate Differential Predicted Median Survival Time of Senate Committee Stage of Confirmation Process -- Based on Interquartile Differential [corresponding to Differential Marginal Hazard Ratio Estimates] **

margins, predict(median time) at(loyalppdiff=(-0.3960373 0.9710589))  contrast(atcontrast(r))

matrix modelA22azloyal = r(table)
mat list modelA22azloyal



estimates restore modela22

margins, predict(median time) at(loyalppdiff=(-.6691019 1.733512))
margins, predict(median time) at(loyalppdiff=(-.6691019 1.733512))  contrast(atcontrast(r))

matrix modelA22bzloyal = r(table)
mat list modelA22bzloyal


***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************



*Figure A1

matrix pointmodel = model2zloyal[1,1], model4zloyal[1,1], model4zloyal[7,1], modelA11zloyal[1,1], modelA21zloyal[1,1], modelA22zloyal[1,1]

*
matrix cimodel = (model2zloyal[5,1], model4zloyal[5,1], model4zloyal[7,1], modelA11zloyal[5,1], modelA21zloyal[5,1], modelA22zloyal[5,1] \ model2zloyal[6,1], model4zloyal[6,1], model4zloyal[7,1], modelA11zloyal[6,1], modelA21zloyal[6,1], modelA22zloyal[6,1])

coefplot (matrix(pointmodel), ci((cimodel))), grid(none) xline(1, lcolor(red%40) lpattern(dash)) xtitle("Hazard Ratio", size(vsmall) margin(t=2)) ylabel(1 `""Presidential Loyalty x Policy Priority Agencies" "Model 2: Cox Model""'  2 `""Presidential Loyalty x Policy Priority Agencies" "Model 4: Weibull Model""'  3 " " 4 `""Presidential Loyalty x Policy Priority Agencies" "Model A1: Gompertz Model""' 5 `""Presidential Loyalty x Policy Priority Agencies" "Model A2.1: Competing-Risks Model""' 6 `""Presidential Loyalty x Policy Priority Agencies" "Model A2.2: Cox Model""', labsize(vsmall) noticks) mlabel format(%9.3f) mlabposition(12) mlabsize(vsmall) xlabel(0(1)2, angle(0) labsize(vsmall) format(%9.1f)) msymbol(o) mcolor(black) msize(small) title("FIGURE A1", size(small)) ciopts(lcolor(black)) legend(off) subtitle("Marginal Differential Effect of Presidential Loyalty on Appointee Tenure Hazard" "Alternative Parametric Hazards & Data Designs" "[Policy Priority Agencies versus Non-Policy Priority Agencies]", size(vsmall))

graph save "Graph" "C:\Users\Jason\Dropbox\Jason Byers\Co-Authored Projects\Projects with George Krause\Krause Projects\Confirmation Dynamics Project\Appointee Tenure Project\Jason Byers\March 2023\DART (PRQ)\Graphics\FigureA1.gph", replace


***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************

*Figure A2

matrix pointmodel1 = model4azloyal[1,1], model4bzloyal[1,1], model4bzloyal[7,1], modelA11azloyal[1,1], modelA11bzloyal[1,1], modelA12azloyal[1,1], modelA12bzloyal[1,1]


*
matrix cimodel1 = (model4azloyal[5,1], model4bzloyal[5,1], model4bzloyal[7,1], modelA11azloyal[5,1], modelA11bzloyal[5,1], modelA12azloyal[5,1], modelA12bzloyal[5,1] \ model4azloyal[6,1], model4bzloyal[6,1], model4bzloyal[7,1], modelA11azloyal[6,1], modelA11bzloyal[6,1], modelA12azloyal[6,1], modelA12bzloyal[6,1])

coefplot (matrix(pointmodel1), ci((cimodel1))), grid(none) xline(0, lcolor(red%40) lpattern(dash)) xtitle("Predicted Number of Days", size(vsmall) margin(t=2)) ylabel(1 `""Presidential Loyalty x Policy Priority Agencies" "Model 4: Interquartile Change""' 2 `""Presidential Loyalty x Policy Priority Agencies" "Model 4: Interdecile Change""' 3 " " 4 `""Presidential Loyalty x Policy Priority Agencies" "Model A1.4: Interquartile Change""' 5 `""Presidential Loyalty x Policy Priority Agencies" "Model A1.4: Interdecile Change""' 6 `""Presidential Loyalty x Policy Priority Agencies" "Model A2.4: Interquartile Change""' 7 `""Presidential Loyalty x Policy Priority Agencies" "Model A2.4: Interdecile Change""', labsize(vsmall) noticks) mlabel format(%9.0f) mlabposition(12) mlabsize(vsmall) xlabel(0(100)800, angle(0) labsize(vsmall) format(%9.0f))   msymbol(o) mcolor(black) msize(small) title("FIGURE A2", size(small)) ciopts(lcolor(black)) legend(off) subtitle("Marginal Differential Effect of Presidential Loyalty Predicting Median Appointee Tenure" "Alternative Parametric Hazards & Data Designs" "[Policy Priority Agencies versus Non-Policy Priority Agencies]", size(vsmall))

graph save "Graph" "C:\Users\Jason\Dropbox\Jason Byers\Co-Authored Projects\Projects with George Krause\Krause Projects\Confirmation Dynamics Project\Appointee Tenure Project\Jason Byers\March 2023\DART (PRQ)\Graphics\FigureA2.gph", replace

***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************


*Kolmogorov-Smirnov Nonparametric Equality of Distributions Test
ksmirnov zloyalmedian, by(soubinaryagency2nom)



***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************


log close

